<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<link rel="stylesheet" href="${pageContext.request.contextPath}/css/header.css">
<script>
    let ROOTSources = "${pageContext.request.contextPath}";
    let customerId = null;
</script>
<div id="header">
    <div class="header">
        <ul class="left_bar">
            <li>
                <a href="${pageContext.request.contextPath}/">
                    <img class="logo" src="${pageContext.request.contextPath}/images/public/logo-white.png"
                         alt="hello world!">
                </a>
            </li>
            <li><a href="${pageContext.request.contextPath}/">首页</a></li>
            <li><a href="${pageContext.request.contextPath}/choose">刷题</a></li>
            <li><a href="${pageContext.request.contextPath}/program">在线编程</a></li>
            <li><a href="${pageContext.request.contextPath}/competitionPage">知识竞赛</a></li>
            <li><a href="${pageContext.request.contextPath}/dynamic">动态</a></li>
        </ul>
        <ul class="loginPart">
            <%--<li>--%>
                <%--<div class="search">--%>
                    <%--<input id="headerSearch" type="text" placeholder="刷题、编程、动态" autocomplete="off">--%>
                    <%--<span class="i_search" id="headerSearchBtn"></span>--%>
                <%--</div>--%>
            <%--</li>--%>
            <c:if test="${sessionScope.loginCustomer==null}">
                <li>
                    <a class="login_button" href="${pageContext.request.contextPath}/login">登录 / 注册</a>
                </li>
            </c:if>
            <c:if test="${sessionScope.loginCustomer!=null}">
                <li>
                    <a href="${pageContext.request.contextPath}/center/${sessionScope.loginCustomer.customerId}/message">
                        消息
                        <span id="customerMessage">
                                ${requestScope.messageCount==0?'':requestScope.messageCount}
                        </span>
                    </a>
                </li>
                <li>
                    <a href="${pageContext.request.contextPath}/center/${sessionScope.loginCustomer.customerId}/basic">个人中心</a>
                </li>
                <li>
                    <a href="${pageContext.request.contextPath}/customer/logout">退出登录</a>
                </li>
                <script>
                    customerId = "${sessionScope.loginCustomer.customerId}"
                </script>
                <script src="${pageContext.request.contextPath}/js/headerOnline.js"></script>
            </c:if>
        </ul>
    </div>
</div>

<script src="${pageContext.request.contextPath}/js/header.js"></script>
